from django.conf.urls import url
from .  import views

from rest_framework_jwt.views import obtain_jwt_token

urlpatterns = [

    # auths/

    # users/usernames/(?P<username>\w{5,20})/count/
    url(r'^usernames/(?P<username>\w{5,20})/count/$',views.RegisterUsernameCountAPIView.as_view()),
    # users/
    url(r'^$',views.RegisterUserAPIView.as_view()),

    # JWT的登陆认证
    url(r'^auths/$', obtain_jwt_token),

    # url(r'^infos/(?P<pk>\d+)/$',views.UserCenterInfoAPIView.as_view()),
    url(r'^infos/$',views.UserCenterInfoAPIView.as_view()),

    url(r'^emails/$',views.EmailUpdateAPIView.as_view()),


    url(r'^emails/verification/$',views.EmailVerificationAPIView.as_view()),

    url(r'^addresses/$',views.AddressesCreateAPIView.as_view()),

]

#  注册完成之后实现自动登陆
#  注册完成之后
#   什么是自动登陆 （ 注册完成之后，给它一个 token）

